package com.team.mp.mapper.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.team.mp.mapper.dto.*;
import com.team.mp.mapper.entity.Serviceinfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

/**
 * 千锋郑州Java学科欢迎你
 * @program: Tproject
 * @description: 持久层 定义操作数据库的方法
 * @author: lx
 * @create: 2023-03-27 11:59:17
 */
public interface ServiceinfoDao extends BaseMapper<Serviceinfo> {
    @Update("update t_serviceinfo set s_order=CONCAT(curdate()+0,LPAD(id,4,0)) WHERE id = #{id}")
    public int updateSOrderInt(int id);

    Page<ServiceSearchDto> selectInfo(@Param("page") Page<ServiceSearchDto> page,@Param("deptId") Integer deptId, @Param("teamId") Integer teamId,
                                      @Param("spId") Integer spId, @Param("status") Integer status,
                                      @Param("ctime") Date ctime);

    Page<ServiceinfoSearchDto> selectListInfo(@Param("page") Page<ServiceinfoSearchDto> page,
                                              @Param("doctorId") Integer doctorId,
                                              @Param("spId") Integer spId,
                                              @Param("status") Integer status);

    ServiceinfoDetailAuditDto selectAuditById(Integer sid);

    ServiceinfoDetailCancelDto selectCancelById(Integer sid);

    ServiceinfoDetailFinishedDto selectFinishedById(Integer sid);

}
